package mywebapp.tools.struts;

import mywebapp.impl.*;
import mywebapp.dao.*;
import mywebapp.webpage.*;

public class FORMULAIRE_STRUTS
{
  protected static String nl;
  public static synchronized FORMULAIRE_STRUTS create(String lineSeparator)
  {
    nl = lineSeparator;
    FORMULAIRE_STRUTS result = new FORMULAIRE_STRUTS();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<html:hidden property=\"id\" value=\"${ ";
  protected final String TEXT_2 = ".ID }\"/>" + NL + "    \t<html:errors />";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    Form form = (Form) argument; 
    
    for(Object  o: form.getEntities()){
    	Entity e = (Entity)o;
    	
    stringBuffer.append(TEXT_1);
    stringBuffer.append(e.getName());
    stringBuffer.append(TEXT_2);
    }


    return stringBuffer.toString();
  }
}
